<!DOCTYPE html>



  


<html class="theme-next mist use-motion" lang="zh-CN">
<head><meta name="generator" content="Hexo 3.8.0">
  <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="theme-color" content="#222">



  
  
    
      
    
    
      
    
  <script src="//cdn.bootcss.com/pace/1.0.2/pace.min.js"></script>
  <link href="//cdn.bootcss.com/pace/1.0.2/themes/blue/pace-theme-flash.min.css" rel="stylesheet">







<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">
















  
  
    
  
  <link href="//cdn.jsdelivr.net/fancybox/2.1.5/jquery.fancybox.min.css" rel="stylesheet" type="text/css">







<link href="/blog/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css">

<link href="/blog/css/main.css?v=5.1.4" rel="stylesheet" type="text/css">


  <link rel="apple-touch-icon" sizes="180x180" href="/blog/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/blog/images/favicon-32x32-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/blog/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/blog/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="智能车比赛,NXP,项目实战,">





  <link rel="alternate" href="/blog/atom.xml" title="二货严の博客" type="application/atom+xml">






<meta name="description" content="前言：从组队到现在已经过去一个多月了，寒假这么长时间算是储备知识的时候，到处寻找资料避免不了做很多无用功，当时我就决定在开始做车的时候把整个过程总结记录下来。不仅是前人栽树后人乘凉，也是对自己的一个阶段性总结，记录一下自己的学习路线和成长过程，也方便团队内部分享交流。开学已经两周了，期间开过几次会，因为大家在智能车方面的知识有限，很多前期的工作必须要谨慎处理，不然可能会影响后面的进展。昨天K60刚">
<meta name="keywords" content="智能车比赛,NXP,项目实战">
<meta property="og:type" content="article">
<meta property="og:title" content="智能车阶段性总结（1）">
<meta property="og:url" content="https://erhuoyan.gitee.io/blog/blog/8cbc/index.html">
<meta property="og:site_name" content="二货严の博客">
<meta property="og:description" content="前言：从组队到现在已经过去一个多月了，寒假这么长时间算是储备知识的时候，到处寻找资料避免不了做很多无用功，当时我就决定在开始做车的时候把整个过程总结记录下来。不仅是前人栽树后人乘凉，也是对自己的一个阶段性总结，记录一下自己的学习路线和成长过程，也方便团队内部分享交流。开学已经两周了，期间开过几次会，因为大家在智能车方面的知识有限，很多前期的工作必须要谨慎处理，不然可能会影响后面的进展。昨天K60刚">
<meta property="og:locale" content="zh-CN">
<meta property="og:image" content="https://i.loli.net/2019/03/05/5c7e529d73155.jpg">
<meta property="og:image" content="https://i.loli.net/2019/03/06/5c7ec0b0870d9.jpg">
<meta property="og:image" content="https://i.loli.net/2019/03/05/5c7e91fad66c4.png">
<meta property="og:image" content="https://i.loli.net/2019/03/05/5c7e92341a766.png">
<meta property="og:image" content="https://i.loli.net/2019/03/05/5c7e927303d35.png">
<meta property="og:image" content="https://i.loli.net/2019/03/05/5c7e92b5b5f73.png">
<meta property="og:image" content="https://i.loli.net/2019/03/05/5c7e9adf77b1f.png">
<meta property="og:image" content="https://i.loli.net/2019/03/06/5c7ead944064d.png">
<meta property="og:image" content="https://i.loli.net/2019/03/05/5c7e737b02176.png">
<meta property="og:image" content="https://i.loli.net/2019/03/05/5c7e9cf9dc3fd.png">
<meta property="og:image" content="https://i.loli.net/2019/03/06/5c7e9f3027999.png">
<meta property="og:image" content="https://i.loli.net/2019/03/06/5c7e9e959a8de.png">
<meta property="og:image" content="https://i.loli.net/2019/03/06/5c7ea264cd4da.png">
<meta property="og:updated_time" content="2019-03-11T10:35:07.934Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="智能车阶段性总结（1）">
<meta name="twitter:description" content="前言：从组队到现在已经过去一个多月了，寒假这么长时间算是储备知识的时候，到处寻找资料避免不了做很多无用功，当时我就决定在开始做车的时候把整个过程总结记录下来。不仅是前人栽树后人乘凉，也是对自己的一个阶段性总结，记录一下自己的学习路线和成长过程，也方便团队内部分享交流。开学已经两周了，期间开过几次会，因为大家在智能车方面的知识有限，很多前期的工作必须要谨慎处理，不然可能会影响后面的进展。昨天K60刚">
<meta name="twitter:image" content="https://i.loli.net/2019/03/05/5c7e529d73155.jpg">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/blog/',
    scheme: 'Mist',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: 'Author'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="https://erhuoyan.gitee.io/blog/blog/8cbc/">


 
   <script> 
   (function(i,s,o,g,r,a,m){i["DaoVoiceObject"]=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;a.charset="utf-8";m.parentNode.insertBefore(a,m)})(window,document,"script",('https:' == document.location.protocol ? 'https:' : 'http:') + "//widget.daovoice.io/widget/0f81ff2f.js","daovoice") 
   daovoice('init', { 
      app_id: "7da5cee4" 
      }); 
   daovoice('update'); 
   </script> 


<script>
    (function(){
        if(''){
            if (prompt('请输入文章密码') !== ''){
                alert('密码错误！请询问博主大人！');
                history.back();
            }
        }
    })();
</script>




  <title>智能车阶段性总结（1） | 二货严の博客</title>
  








</head>

<body itemscope="" itemtype="http://schema.org/WebPage" lang="zh-CN">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <a href="https://github.com/erhuoyan" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewbox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"/><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"/><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"/></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style>

    <header id="header" class="header" itemscope="" itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/blog/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">二货严の博客</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle">此后吾之剑与汝同在，汝之命运与吾共存。</p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/blog/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br>
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/blog/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br>
            
            关于
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/blog/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br>
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/blog/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br>
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/blog/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br>
            
            归档
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope="" itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="https://erhuoyan.gitee.io/blog/blog/blog/8cbc/">

    <span hidden itemprop="author" itemscope="" itemtype="http://schema.org/Person">
      <meta itemprop="name" content="耿严">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/blog/images/backgroung.jpg">
    </span>

    <span hidden itemprop="publisher" itemscope="" itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="二货严の博客">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">智能车阶段性总结（1）</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建时间" itemprop="dateCreated datePublished" datetime="2019-03-05T12:59:21+08:00">
                2019-03-05
              </time>
            

            

            
          </span>

          
            <span class="post-category">
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope="" itemtype="http://schema.org/Thing">
                  <a href="/blog/categories/NXP智能车比赛/" itemprop="url" rel="index">
                    <span itemprop="name">NXP智能车比赛</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          
             <span id="/blog/blog/8cbc/" class="leancloud_visitors" data-flag-title="智能车阶段性总结（1）">
               <span class="post-meta-divider">|</span>
               <span class="post-meta-item-icon">
                 <i class="fa fa-eye"></i>
               </span>
               
                 <span class="post-meta-item-text">Visitors&#58;</span>
               
                 <span class="leancloud-visitors-count"></span>
             <span>℃</span>
	     </span>
          

          
            <span class="post-meta-divider">|</span>
            <span class="page-pv">本文总阅读量
            <span class="busuanzi-value" id="busuanzi_value_page_pv"></span>次
            </span>
          

          
            <div class="post-wordcount">
              
                
                <span class="post-meta-item-icon">
                  <i class="fa fa-file-word-o"></i>
                </span>
                
                  <span class="post-meta-item-text">Words count in article&#58;</span>
                
                <span title="Words count in article">
                  2.6k 字
                </span>
              

              
                <span class="post-meta-divider">|</span>
              

              
                <span class="post-meta-item-icon">
                  <i class="fa fa-clock-o"></i>
                </span>
                
                  <span class="post-meta-item-text">Reading time &asymp;</span>
                
                <span title="Reading time">
                  8 分钟
                </span>
              
            </div>
          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <div class="note "><p>前言：从组队到现在已经过去一个多月了，寒假这么长时间算是储备知识的时候，到处寻找资料避免不了做很多无用功，当时我就决定在开始做车的时候把整个过程总结记录下来。不仅是前人栽树后人乘凉，也是对自己的一个阶段性总结，记录一下自己的学习路线和成长过程，也方便团队内部分享交流。开学已经两周了，期间开过几次会，因为大家在智能车方面的知识有限，很多前期的工作必须要谨慎处理，不然可能会影响后面的进展。昨天K60刚到货，引脚分配也是修改了第三次。以后配件可能会陆续到货，第一阶段也就到这里了。</p></div>
<a id="more"></a>
<h2 id="智能车设计方案"><a href="#智能车设计方案" class="headerlink" title="智能车设计方案"></a>智能车设计方案</h2><p>由于安徽大学已经连续参加了好几届智能车比赛，有了很多经验和总结。某些软件和硬件策咯已经很成熟了，所以也不必花太多时间去制定设计方案，可以参考近几届学长的方案，必要的地方做些改动即可。下面就对我们采用的方案进行一下整理，也梳理一下我的学习路线。</p>
<h3 id="硬件电路"><a href="#硬件电路" class="headerlink" title="硬件电路"></a>硬件电路</h3><h4 id="电机驱动"><a href="#电机驱动" class="headerlink" title="电机驱动"></a>电机驱动</h4><p>根据学长的建议我们应该选择C车模也就是双电机车模，所以电机驱动板也要是双电机驱动。安徽大学的电机驱动板已经做的比较成熟了，使用的是英飞凌的经典驱动组合IR2104+IR7843组成的驱动电路。原理图如下所示：<br><img src="https://i.loli.net/2019/03/05/5c7e529d73155.jpg" alt="IR2104+IR7843驱动原理图"><br>从IR2104出来的信号加在mos管的栅极，高电平使得mos管导通，低电平截止。</p>
<blockquote>
<p>以下资料可帮助理解电机驱动</p>
</blockquote>
<ul>
<li><a href="https://gitee.com/erhuoyan/NXP/blob/master/%E7%94%B5%E6%9C%BA%E9%A9%B1%E5%8A%A8%E5%8E%9F%E7%90%86%E7%AE%80%E4%BB%8B.md" target="_blank" rel="noopener">电机驱动原理简介（来自学长）</a></li>
<li><a href="https://gitee.com/erhuoyan/NXP/tree/master/%E7%94%B5%E6%9C%BA%E9%A9%B1%E5%8A%A8%E5%8F%82%E8%80%83%E8%AE%BE%E8%AE%A1" target="_blank" rel="noopener">安徽大学电机驱动参考</a></li>
<li><a href="https://wenku.baidu.com/view/637b225d0b1c59eef8c7b490.html?from=search" target="_blank" rel="noopener">常用电机驱动原理</a></li>
</ul>
<h4 id="信号采集电路"><a href="#信号采集电路" class="headerlink" title="信号采集电路"></a>信号采集电路</h4><p>因为我们是小白四轮组，今年不再限制传感器数量，但是对车身长度和高度进行了限制，所以要完成比赛必须要同时使用使用摄像头和电感两种传感器。</p>
<p>电磁传感器需要设计采集电路，摄像头不需要设计采集电路。由于ADC模块引脚有限，而且摄像头模块会用到大量引脚，所以在前几届八路采集电路基础上删掉两路改为六路信号采集。不仅如此，在研究12届电磁单车程序的时候发现他们实际只用了三路AD采集，具体原因可能要到后期调试的时候再深究了。</p>
<blockquote>
<p>参考12届电磁信号采集板,改为六路即可</p>
</blockquote>
<ul>
<li><a href="https://gitee.com/erhuoyan/NXP/tree/master/%E7%AC%AC12%E5%B1%8A%E7%94%B5%E7%A3%81%E7%BB%84%E5%8D%95%E8%BD%A6%E2%80%94%E2%80%94B%E8%BD%A6" target="_blank" rel="noopener">安徽大学电磁电路参考</a></li>
</ul>
<h4 id="主控板"><a href="#主控板" class="headerlink" title="主控板"></a>主控板</h4><p>近两届安大智能车比赛都是使用龙邱的MK60DN512VL10，K60由很多系列,由于学长的推荐我们便没在核心板的选择上费心思考。</p>
<p><img src="https://i.loli.net/2019/03/06/5c7ec0b0870d9.jpg" alt="MK60DN512VLL10"></p>
<p>第一块主板建议采用直插式，在确定主板硬件没有bug后可以改为贴片式：</p>
<table>
<thead>
<tr>
<th style="text-align:center">对比</th>
<th style="text-align:center">直插式</th>
<th style="text-align:center">贴片式</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">原理图</td>
<td style="text-align:center"><img src="https://i.loli.net/2019/03/05/5c7e91fad66c4.png" alt="直插式原理图"></td>
<td style="text-align:center"><img src="https://i.loli.net/2019/03/05/5c7e92341a766.png" alt="贴片式原理图"></td>
</tr>
<tr>
<td style="text-align:center">PCB</td>
<td style="text-align:center"><img src="https://i.loli.net/2019/03/05/5c7e927303d35.png" alt="PCB直插式"></td>
<td style="text-align:center"><img src="https://i.loli.net/2019/03/05/5c7e92b5b5f73.png" alt="贴片式PCB"></td>
</tr>
</tbody>
</table>
<p>由对比可以看出贴片式的难度较大，而且K60的焊接还是比较困难的，但是贴片K60价格会便宜一些，所占空间也会更小。后期如果有时间和兴趣可以挑战一下。</p>
<p>主控板的设计方案也是有参考的，关键就是引脚分配了。前面已经说了今年要分出6个ADC引脚用作电磁信号采集，而且使用C车模有两个电机，也就需要4路pwm，同时需要两个编码器。</p>
<div class="note danger"><p>每个FTM模块只能设置一种频率。所以电机，舵机，编码器要分别占用一个FTM模块。</p></div>
<p>所以K60的三个FTM模块要这样分配：FTM0模块分出4个引脚用来输出PWM控制电机，FTM1控制舵机，而FTM2只能控制一个编码器，另一个编码器就需要用到低功耗计数器模块，引脚是固定的，为PTC5。</p>
<p>摄像头的引脚也是固定的，蓝牙引脚常为PTE24和PTE25,主板上还要有12864液晶接口占用5个普通IO口,蜂鸣器，拨码开关，按键都需要普通IO口。参考11届摄像头C车：</p>
<ul>
<li><a href="https://gitee.com/erhuoyan/NXP/tree/master/%E7%AC%AC11%E5%B1%8A%E6%91%84%E5%83%8F%E5%A4%B4%E5%8F%8C%E8%BD%A6%E2%80%94%E2%80%94C%E8%BD%A6" target="_blank" rel="noopener">安徽大学主板电路参考</a></li>
</ul>
<h5 id="引脚分配方案："><a href="#引脚分配方案：" class="headerlink" title="引脚分配方案："></a>引脚分配方案：</h5><p><img src="https://i.loli.net/2019/03/05/5c7e9adf77b1f.png" alt="引脚分配"></p>
<div class="note danger"><p>注意考虑J-LINK的引脚，这些引脚被占用不知道下载会不会出错，还是不要占用的好。</p></div>
<p>学长给的一个文档统计了K60的AD和FTM模块所有引脚，但是后来发现那是144pin的引脚统计，有些在100pin的K60上就找不到。</p>
<h3 id="软件编程"><a href="#软件编程" class="headerlink" title="软件编程"></a>软件编程</h3><h4 id="底层库"><a href="#底层库" class="headerlink" title="底层库"></a>底层库</h4><p>K60是ARM的一种，编程不像之前C51和arduino那样。但是现在已经有很多开源的K60底层库，使用这些库就有点类似arduino编程一样调用库函数就行。近几年安大采用的是LPLD的开源底层库,官方已经不再维护了。可以直接clone我的<a href="https://gitee.com/erhuoyan/NXP" target="_blank" rel="noopener">码云</a>仓库,里边还有LPLD官方<strong>例程</strong>和<strong>教程</strong>，都是改过bug的。</p>
<h4 id="必备软件"><a href="#必备软件" class="headerlink" title="必备软件"></a>必备软件</h4><ul>
<li>Altium Designer 绘制原理图和PCB。建议使用16或17版本。</li>
<li>IAR K60编程软件</li>
</ul>
<h4 id="初试K60"><a href="#初试K60" class="headerlink" title="初试K60"></a>初试K60</h4><blockquote>
<p>昨天学姐买的K60和J-LINK到货了，我的任务就是测试。我打算测试一下它的串口通信功能。</p>
</blockquote>
<p>我下载了官方例程中的第一个程序，用串口在电脑上打印HelloWold。使用J-link需要先安装J-link驱动，虽然安装IAR时已经安装了J-link驱动，但是为了让驱动和硬件版本一致，还是使用硬件配套的驱动较好。</p>
<p>程序编译，下载都没有错误。但是遇到一个问题是，串口调试助手检索不到串口，在电脑的设备管理器中也找不到串口设备的存在。当时弄了好久，最后换了一个UART例程，这才发现，程序初始化PTA14,PTA15为UART引脚，但是J-link并没有连接这两个引脚。这才意识到自己先入为主了。在使用C51和arduino的时候，下载端口同时也是串口，K60并不是这样。我找到之前做遥控车时用过的USB转TTL模块，连接发送端和接收端，安装usb转串口驱动后连接电脑就能在设备管理器中发现串口了。</p>
<p><img src="https://i.loli.net/2019/03/06/5c7ead944064d.png" alt="串口"></p>
<p>下面再使用IAR下载程序，就可以使用串口助手进行通信了。明天再试试蓝牙主从机的功能。</p>
<div class="note warning"><p>IAR在下载程序的时候有两种模式，一种是RAM模式，只能将程序下载到RAM中，断电后程序丢失。第二种是FLASH模式，将程序下载到单片机的FLASH中，断电后程序不会丢失。我做的测试仅在RAM模式下进行。</p></div>
<h3 id="思考感悟"><a href="#思考感悟" class="headerlink" title="思考感悟"></a>思考感悟</h3><p>万事开头难，刚开始的时候也是一头雾水，只有不停的找资料学习才慢慢对智能车有更清晰的了解。但是没有好的指引通仅靠自己摸索很耗时间。我也是做了很多无用功，导致现在思路混乱，写这一系列博客也是回顾自己的探索过程，将有用的信息总结下来，让自己思路更清晰。如果由后来人看的话也能作为指导书，避免走弯路，把时间都用在正确的地方。上面已经对我所得信息做了总结，下面做一些心得感悟，也是总结一下自己的思考路线。</p>
<h4 id="对主控板的一些思考"><a href="#对主控板的一些思考" class="headerlink" title="对主控板的一些思考"></a>对主控板的一些思考</h4><ul>
<li>MCU</li>
</ul>
<p>虽然安大一直使用的是K60DN512VLL10。实际上野火做了性能测试:</p>
<p><img src="https://i.loli.net/2019/03/05/5c7e737b02176.png" alt="性能测试"></p>
<p>FX系列要比DN系列性能快，K60的FX/FN浮点性能是DN的5倍多。由于我们使用的是LPLD库，已经不再更新，虽然最后一个版本中添加了对F系列的支持，但没有前人的经验，时间紧迫下还是不敢尝试。保守起见还是使用DN512，但是100pin真的有点老了，尤其是在分配引脚的时候，感觉到100pin对于摄像头和电感同时使用有点吃力，尽管最后勉强够用后期不知道会不会负载过大而出错。所以我认为这一届最优的选择应该是144pin的MK60DN512VLQ10做主控。</p>
<h4 id="ADC引脚的一些疑问"><a href="#ADC引脚的一些疑问" class="headerlink" title="ADC引脚的一些疑问"></a>ADC引脚的一些疑问</h4><p>其实ADC功能引脚还是挺多的，但是有些都带有特殊功能.</p>
<p><img src="https://i.loli.net/2019/03/05/5c7e9cf9dc3fd.png" alt="PTE"></p>
<p>这些SE应该代表精度，在学长的程序里定义的精度为10，所以我一开始尽量寻找SE10以上的AD引脚，甚至不下心把J-LINK的引脚占用了。但是后来发现初始化程序里的PTB0和PTB1分别是SE8和SE9然后我就放弃纠结这个问题了：</p>
<p><img src="https://i.loli.net/2019/03/06/5c7e9f3027999.png" alt="ADC"></p>
<p><img src="https://i.loli.net/2019/03/06/5c7e9e959a8de.png" alt="PTB"></p>
<p>还有些引脚看着比较特别：</p>
<p><img src="https://i.loli.net/2019/03/06/5c7ea264cd4da.png" alt="AD"></p>
<p>以后再研究有什么特别的地方。目前只知道与DMA和PDB有关。</p>
<h4 id="对底层库选择的建议"><a href="#对底层库选择的建议" class="headerlink" title="对底层库选择的建议"></a>对底层库选择的建议</h4><p>由于安大前几届都是使用LPLD底层库，但是这个库官方已经不在更新了，而且教程极少，只有一个官方文档，虽然使用简单，但是学起来较困难，例程也不是很多。对K60F系列的支持性未知。因为现在时间比较紧，没有时间再去学一个新的底层库。</p>
<p>K60的开源底层库有很多，其中用的比较多的是山外的底层库。山外有其自主经营的智能车论坛，建议下一届考虑一下使用山外的底层库，配有文档教程和视频教程。配合F系列高性能的MCU。说不定会有一个突破。</p>
<h2 id="附"><a href="#附" class="headerlink" title="附"></a>附</h2><blockquote>
<p>附上一些前文提到的链接</p>
</blockquote>
<ul>
<li>本队仓库：<a href="https://github.com/erhuoyan/NXP_car" target="_blank" rel="noopener">GitHub</a></li>
<li>资料仓库：<a href="https://gitee.com/erhuoyan/NXP" target="_blank" rel="noopener">码云</a></li>
<li>AD：<a href="https://www.pcbbar.com/thread-6847-1-1.html" target="_blank" rel="noopener">视频教程</a></li>
<li>团队协作：<a href="https://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000" target="_blank" rel="noopener">Git教程</a></li>
<li>智能车论坛：<ul>
<li><a href="http://www.znczz.com/home.php?mod=space&amp;do=notice&amp;view=system" target="_blank" rel="noopener">智能车制作</a>:官方论坛，可以下载往届技术报告</li>
<li><a href="http://www.vcan123.com/forum.php?mod=collection&amp;action=view&amp;ctid=26" target="_blank" rel="noopener">山外论坛</a>:原野火论坛，可以学习野火底层库</li>
</ul>
</li>
</ul>

      
    </div>
    
    
    

<div>
  
    <div>  <div style="text-align:center;color: #555;font-size:14px;">-------------The End-------------</div>  </div>

  
</div>

<div>
      
         <div class="my_post_copyright"> <script src="//cdn.bootcss.com/clipboard.js/1.5.10/clipboard.min.js"></script> <!-- JS库 sweetalert 可修改路径 --> <script src="https://cdn.bootcss.com/jquery/2.0.0/jquery.min.js"></script> <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script> <p><span>本文标题:</span><a href="/blog/blog/8cbc/">智能车阶段性总结（1）</a></p> <p><span>文章作者:</span><a href="/" title="访问 耿严 的个人博客">耿严</a></p> <p><span>发布时间:</span>2019年03月05日 - 12:03</p> <p><span>最后更新:</span>2019年03月11日 - 18:03</p> <p><span>原始链接:</span><a href="/blog/blog/8cbc/" title="智能车阶段性总结（1）">https://erhuoyan.gitee.io/blog/blog/8cbc/</a> <span class="copy-path" title="点击复制文章链接"><i class="fa fa-clipboard" data-clipboard-text="https://erhuoyan.gitee.io/blog/blog/8cbc/" aria-label="复制成功！"></i></span> </p> <p><span>许可协议:</span><i class="fa fa-creative-commons"></i> <a rel="license" href="https://creativecommons.org/licenses/by-nc-nd/4.0/" target="_blank" title="Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)">署名-非商业性使用-禁止演绎 4.0 国际</a> 转载请保留原文链接及作者。</p> </div> <script> var clipboard = new Clipboard('.fa-clipboard'); $(".fa-clipboard").click(function(){ clipboard.on('success', function(){ swal({ title: "", text: '复制成功', icon: "success", showConfirmButton: true }); }); }); </script> 

      
</div>

    
      <div>
        <div id="wechat_subscriber" style="display: block; padding: 10px 0; margin: 20px auto; width: 100%; text-align: center">
    <img id="wechat_subscriber_qcode" src="/uploads/qrcode_for_gh_cf4b7b7f445a_430.jpg" alt="耿严 wechat" style="width: 200px; max-width: 100%;">
    <div>欢迎您扫一扫上面的微信公众号，订阅我的博客</div>
</div>

      </div>
    

    
      <div>
        <div style="padding: 10px 0; margin: 20px auto; width: 90%; text-align: center;">
  <div>坚持原创技术分享，您的支持将鼓励我继续创作！</div>
  <button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}">
    <span>打赏</span>
  </button>
  <div id="QR" style="display: none;">

    
      <div id="wechat" style="display: inline-block">
        <img id="wechat_qr" src="/images/wechatpay.jpg" alt="耿严 微信支付">
        <p>微信支付</p>
      </div>
    

    
      <div id="alipay" style="display: inline-block">
        <img id="alipay_qr" src="/images/alipay.jpg" alt="耿严 支付宝">
        <p>支付宝</p>
      </div>
    

    

  </div>
</div>

      </div>
    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/blog/tags/智能车比赛/" rel="tag"><i class="fa fa-tag"></i> 智能车比赛</a>
          
            <a href="/blog/tags/NXP/" rel="tag"><i class="fa fa-tag"></i> NXP</a>
          
            <a href="/blog/tags/项目实战/" rel="tag"><i class="fa fa-tag"></i> 项目实战</a>
          
        </div>
      

      
      
        <div class="post-widgets">
        
          <div class="wp_rating">
            <div id="wpac-rating"></div>
          </div>
        

        

        
        </div>
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/blog/blog/38a3/" rel="next" title="The Zen of Python">
                <i class="fa fa-chevron-left"></i> The Zen of Python
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/blog/blog/c062/" rel="prev" title="hexo备份与恢复">
                hexo备份与恢复 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
        <!-- Go to www.addthis.com/dashboard to customize your tools -->
<div class="addthis_inline_share_toolbox">
  <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-5bfe60f3b5b5d5ce" async="async"></script>
</div>

      
    </div>
  </div>


          </div>
          


          

  
    <div class="comments" id="comments">
      <div id="lv-container" data-id="city" data-uid="MTAyMC80MTMzMi8xNzg3OQ=="></div>
    </div>

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope="" itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image" src="/blog/images/backgroung.jpg" alt="耿严">
            
              <p class="site-author-name" itemprop="name">耿严</p>
              <p class="site-description motion-element" itemprop="description">已有之事后必再有，已行之事后必再行。</p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/blog/archives/">
              
                  <span class="site-state-item-count">17</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/blog/categories/index.html">
                  <span class="site-state-item-count">7</span>
                  <span class="site-state-item-name">分类</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/blog/tags/index.html">
                  <span class="site-state-item-count">25</span>
                  <span class="site-state-item-name">标签</span>
                </a>
              </div>
            

          </nav>

          
            <div class="feed-link motion-element">
              <a href="/blog/atom.xml" rel="alternate">
                <i class="fa fa-rss"></i>
                RSS
              </a>
            </div>
          

          
            <div class="links-of-author motion-element">
                
                  <span class="links-of-author-item">
                    <a href="https://github.com/erhuoyan" target="_blank" title="GitHub">
                      
                        <i class="fa fa-fw fa-github"></i>GitHub</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://blog.csdn.net/qq_33520219" target="_blank" title="CSDN">
                      
                        <i class="fa fa-fw fa-rotate-right"></i>CSDN</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://gitee.com/erhuoyan" target="_blank" title="gitee">
                      
                        <i class="fa fa-fw fa-copyright"></i>gitee</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://weibo.com/u/6018509665/home?leftnav=1" target="_blank" title="微博">
                      
                        <i class="fa fa-fw fa-weibo"></i>微博</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://i.loli.net/2018/12/11/5c0f3d8415cba.png" target="_blank" title="QQ">
                      
                        <i class="fa fa-fw fa-qq"></i>QQ</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://i.loli.net/2018/12/11/5c0f3c7adebe1.png" target="_blank" title="微信">
                      
                        <i class="fa fa-fw fa-weixin"></i>微信</a>
                  </span>
                
            </div>
          

          
          

          
          
            <div class="links-of-blogroll motion-element links-of-blogroll-inline">
              <div class="links-of-blogroll-title">
                <i class="fa  fa-fw fa-link"></i>
                Links
              </div>
              <ul class="links-of-blogroll-list">
                
                  <li class="links-of-blogroll-item">
                    <a href="http://www.yilan.io" title="一览" target="_blank">一览</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://www.eksecorp.com/" title="忆苦思甜(翻译国外文章)" target="_blank">忆苦思甜(翻译国外文章)</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="http://www.ruanyifeng.com/" title="阮一峰blog" target="_blank">阮一峰blog</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="http://www.ireadweek.com" title="周读" target="_blank">周读</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="http://www.shuwu.mobi" title="我的小书屋" target="_blank">我的小书屋</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://www.bilibili.com/" title="B站" target="_blank">B站</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://juejin.im/" title="掘金" target="_blank">掘金</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://maxiang.io" title="马克飞象" target="_blank">马克飞象</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://bookist.cc/" title="书大师" target="_blank">书大师</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://sm.ms/" title="SM.MS(图床)" target="_blank">SM.MS(图床)</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://www.jianshu.com/u/4312c933b9db" title="极客江南(web)" target="_blank">极客江南(web)</a>
                  </li>
                
              </ul>
            </div>
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#智能车设计方案"><span class="nav-number">1.</span> <span class="nav-text">智能车设计方案</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#硬件电路"><span class="nav-number">1.1.</span> <span class="nav-text">硬件电路</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#电机驱动"><span class="nav-number">1.1.1.</span> <span class="nav-text">电机驱动</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#信号采集电路"><span class="nav-number">1.1.2.</span> <span class="nav-text">信号采集电路</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#主控板"><span class="nav-number">1.1.3.</span> <span class="nav-text">主控板</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#引脚分配方案："><span class="nav-number">1.1.3.1.</span> <span class="nav-text">引脚分配方案：</span></a></li></ol></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#软件编程"><span class="nav-number">1.2.</span> <span class="nav-text">软件编程</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#底层库"><span class="nav-number">1.2.1.</span> <span class="nav-text">底层库</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#必备软件"><span class="nav-number">1.2.2.</span> <span class="nav-text">必备软件</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#初试K60"><span class="nav-number">1.2.3.</span> <span class="nav-text">初试K60</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#思考感悟"><span class="nav-number">1.3.</span> <span class="nav-text">思考感悟</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#对主控板的一些思考"><span class="nav-number">1.3.1.</span> <span class="nav-text">对主控板的一些思考</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#ADC引脚的一些疑问"><span class="nav-number">1.3.2.</span> <span class="nav-text">ADC引脚的一些疑问</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#对底层库选择的建议"><span class="nav-number">1.3.3.</span> <span class="nav-text">对底层库选择的建议</span></a></li></ol></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#附"><span class="nav-number">2.</span> <span class="nav-text">附</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

<div id="music163player">
<iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width="330" height="86" src="//music.163.com/outchain/player?type=2&id=285100&auto=1&height=66"></iframe>
  </div>


      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; 2018 &mdash; <span itemprop="copyrightYear">2019</span>
  <span class="with-love">
    <i class="fa fa-snowflake-o"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">耿严</span>

  
</div>

<!--

  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>




  <span class="post-meta-divider">|</span>

-->


  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Mist</a> v5.1.4</div>






  <span class="post-meta-divider">|</span>



<div class="theme-info">
  <div class="powered-by"></div>
  <span class="post-count">博客全站共18.5k字</span>
</div>


        
<div class="busuanzi-count">
  <script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>

  
    <span class="site-uv">
      本站访客数
      <span class="busuanzi-value" id="busuanzi_value_site_uv"></span>
      人次
    </span>
  

  
    <span class="site-pv">
      本站总访问量
      <span class="busuanzi-value" id="busuanzi_value_site_pv"></span>
      次
    </span>
  
</div>








        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  


  











  
  
    <script type="text/javascript" src="//cdn.jsdelivr.net/jquery/2.1.3/jquery.min.js"></script>
  

  
  
    <script type="text/javascript" src="//cdn.jsdelivr.net/fastclick/1.0.6/fastclick.min.js"></script>
  

  
  
    <script type="text/javascript" src="//cdn.jsdelivr.net/jquery.lazyload/1.9.3/jquery.lazyload.min.js"></script>
  

  
  
    <script type="text/javascript" src="//cdn.jsdelivr.net/velocity/1.2.3/velocity.min.js"></script>
  

  
  
    <script type="text/javascript" src="//cdn.jsdelivr.net/velocity/1.2.3/velocity.ui.min.js"></script>
  

  
  
    <script type="text/javascript" src="//cdn.jsdelivr.net/fancybox/2.1.5/jquery.fancybox.pack.js"></script>
  

  
  
    <script type="text/javascript" src="//cdn.bootcss.com/canvas-nest.js/1.0.1/canvas-nest.min.js"></script>
  


  


  <script type="text/javascript" src="/blog/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/blog/js/src/motion.js?v=5.1.4"></script>



  
  

  
  <script type="text/javascript" src="/blog/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/blog/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/blog/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  
    <script type="text/javascript">
      (function(d, s) {
        var j, e = d.getElementsByTagName(s)[0];
        if (typeof LivereTower === 'function') { return; }
        j = d.createElement(s);
        j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
        j.async = true;
        e.parentNode.insertBefore(j, e);
      })(document, 'script');
    </script>
  












  





  

  
  <script src="https://cdn1.lncld.net/static/js/av-core-mini-0.6.4.js"></script>
  <script>AV.initialize("GRTjOhQCLhVF3AMYXzAz9Y9v-gzGzoHsz", "NyiBhoCVvKPkazVBtlL0kKq1");</script>
  <script>
    function showTime(Counter) {
      var query = new AV.Query(Counter);
      var entries = [];
      var $visitors = $(".leancloud_visitors");

      $visitors.each(function () {
        entries.push( $(this).attr("id").trim() );
      });

      query.containedIn('url', entries);
      query.find()
        .done(function (results) {
          var COUNT_CONTAINER_REF = '.leancloud-visitors-count';

          if (results.length === 0) {
            $visitors.find(COUNT_CONTAINER_REF).text(0);
            return;
          }

          for (var i = 0; i < results.length; i++) {
            var item = results[i];
            var url = item.get('url');
            var time = item.get('time');
            var element = document.getElementById(url);

            $(element).find(COUNT_CONTAINER_REF).text(time);
          }
          for(var i = 0; i < entries.length; i++) {
            var url = entries[i];
            var element = document.getElementById(url);
            var countSpan = $(element).find(COUNT_CONTAINER_REF);
            if( countSpan.text() == '') {
              countSpan.text(0);
            }
          }
        })
        .fail(function (object, error) {
          console.log("Error: " + error.code + " " + error.message);
        });
    }

    function addCount(Counter) {
      var $visitors = $(".leancloud_visitors");
      var url = $visitors.attr('id').trim();
      var title = $visitors.attr('data-flag-title').trim();
      var query = new AV.Query(Counter);

      query.equalTo("url", url);
      query.find({
        success: function(results) {
          if (results.length > 0) {
            var counter = results[0];
            counter.fetchWhenSave(true);
            counter.increment("time");
            counter.save(null, {
              success: function(counter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(counter.get('time'));
              },
              error: function(counter, error) {
                console.log('Failed to save Visitor num, with error message: ' + error.message);
              }
            });
          } else {
            var newcounter = new Counter();
            /* Set ACL */
            var acl = new AV.ACL();
            acl.setPublicReadAccess(true);
            acl.setPublicWriteAccess(true);
            newcounter.setACL(acl);
            /* End Set ACL */
            newcounter.set("title", title);
            newcounter.set("url", url);
            newcounter.set("time", 1);
            newcounter.save(null, {
              success: function(newcounter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(newcounter.get('time'));
              },
              error: function(newcounter, error) {
                console.log('Failed to create');
              }
            });
          }
        },
        error: function(error) {
          console.log('Error:' + error.code + " " + error.message);
        }
      });
    }

    $(function() {
      var Counter = AV.Object.extend("Counter");
      if ($('.leancloud_visitors').length == 1) {
        addCount(Counter);
      } else if ($('.post-title-link').length > 1) {
        showTime(Counter);
      }
    });
  </script>



  

  

  
  
  <script type="text/javascript">
  wpac_init = window.wpac_init || [];
  wpac_init.push({widget: 'Rating', id: 15247,
    el: 'wpac-rating',
    color: 'fc6423'
  });
  (function() {
    if ('WIDGETPACK_LOADED' in window) return;
    WIDGETPACK_LOADED = true;
    var mc = document.createElement('script');
    mc.type = 'text/javascript';
    mc.async = true;
    mc.src = '//embed.widgetpack.com/widget.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(mc, s.nextSibling);
  })();
  </script>


  

  

  

   
      <canvas class="fireworks" style="position: fixed;left: 0;top: 0;z-index: 1; pointer-events: none;"></canvas> 
      <script type="text/javascript" src="//cdn.bootcss.com/animejs/2.2.0/anime.min.js"></script> 
      <!--<script type="text/javascript" src="/js/src/fireworks.js"></script>-->
      <!-- 页面点击小红心 -->
      <script type="text/javascript" src="/js/src/love.js"></script>

<script src="/blog/live2dw/lib/L2Dwidget.min.js?0c58a1486de42ac6cc1c59c7d98ae887"></script><script>L2Dwidget.init({"model":{"jsonPath":"/blog/live2dw/assets/wanko.model.json"},"display":{"position":"right","width":100,"height":200},"mobile":{"show":true},"log":false,"pluginJsPath":"lib/","pluginModelPath":"assets/","pluginRootPath":"live2dw/","tagMode":false});</script></body>
</html>
